<aside class="lg-side">
  <div class="panel-heading tab-bg-dark-navy-blue okr-tab-head tab-right "></div>
  <div class="inbox-body mi-h8">
    <div class="row">
      <div class="col-lg-12 hidebox" id="telbox">
        <section class="panel">
          <header class="panel-heading">
            联系人信息
          </header>
          <div class="panel-body">
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">联系人名称*</label>
              <div class="col-sm-10">
                <input type="text" id="cusName" class="form-control" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">联系方式*</label>
              <div class="col-sm-10">
                <input type="text" id="phone" onblur="telNo(this.id)" class="form-control" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">邮件地址*</label>
              <div class="col-sm-10">
                <input type="text" id="email" class="form-control" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">注释</label>
              <div class="col-sm-10">
                <textarea class="form-control" id="backDesc" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');" maxlength="120" placeholder="字数限制(120字以内)"></textarea>
              </div>
            </div>
            <p class="default-buttons">
              <a href="javascript:void(0);" class="button-back btn btn-info" onclick="toBack()">返回</a>
              <a href="javascript:void(0);" class="button-next  btn btn-info update">提交</a>
            </p>
          </div>
        </section>
      </div>
    </div>
  </div>
</aside>
<script>
    var comId =0;
    function updateLxr($certusUtils,id) {
      $certusUtils.ajax("findLxrInfo",{"id":id},function (response) {
          var data = response.data;
          comId = data.comId;
          $("#phone").val(data.telePhone);
          $("#cusName").val(data.cusName);
          $("#email").val(data.email);
          $("#backDesc").val(data.cusDesc);
      });
      $(".update").on('click',function () {
          var data={};
          data.telePhone = $("#phone").val();
          data.cusName = $("#cusName").val();
          data.email = $("#email").val();
          if(data.cusName == "" || data.cusName == null || data.cusName == undefined){
            layer.msg("联系人名称不能为空！");
            return;
          }
          if(data.telePhone == "" || data.telePhone == null || data.telePhone == undefined){
            layer.msg("联系方式不能为空！");
            return;
          }
          if(data.email == "" || data.email == null || data.email == undefined){
            layer.msg("邮件地址不能为空！");
            return;
          }
          data.cusDesc = $("#backDesc").val();
          data.comId = comId;
          data.id = id;
          $certusUtils.ajax("addLxr",{"data":JSON.stringify(data),"projId":proId},function (response) {
              layer.msg("编辑成功");
              toLoadHtml(6,comId);
          })
      })
  }
  function toBack() {
      toLoadHtml(6,comId);
  }
</script>